/*
*	Copyright (C) 2014  Julio Montes, Mario Carrillo
*	
*	Julio Montes e-mail: imc.coder@gmail.com 
*
*	Mario Carrillo e-mail: mario_90ago@live.com.mx
*
*	BSD 3-Clause License
*/

#ifndef IASETTINGSEDITORDIALOG_H
#define IASETTINGSEDITORDIALOG_H

#include <wx/wx.h>
#include <vector>
#include <wx/spinctrl.h>

///ID's: 801-900

class iaSettingsScrolledWindow : public wxScrolledWindow
{
public:
    iaSettingsScrolledWindow( wxWindow *parent ) : wxScrolledWindow(parent ){}
    virtual void WriteConfig()=0;
protected:
private:

};

class iaSettingsPanel : public wxPanel
{
public:
    iaSettingsPanel( wxWindow *parent ) : wxPanel(parent ){}
    virtual void WriteConfig()=0;
protected:
private:

};



class iaSettingsEditorDialog : public wxDialog
{
public:
    iaSettingsEditorDialog( wxWindow *parent );
    virtual ~iaSettingsEditorDialog();

protected:
private:
    void OnOk( wxCommandEvent &evt );

    std::vector<iaSettingsScrolledWindow *> vectorScrolled;

    DECLARE_EVENT_TABLE()
};







/// GENERAL
class iaSettingsGeneral : public iaSettingsScrolledWindow
{
public:
    iaSettingsGeneral( wxWindow *parent );
    virtual ~iaSettingsGeneral();

    virtual void WriteConfig();
protected:
private:
    std::vector<iaSettingsPanel *> vectorPanel;
};


#define iaID_CHOOSE 801

class iaFontPanel : public iaSettingsPanel
{
public:
    iaFontPanel( wxWindow *parent );
    virtual ~iaFontPanel();

    void OnChoose( wxCommandEvent &evt );

    virtual void WriteConfig();
protected:
private:
    wxStaticText *stSampleText;

    wxFont font;

    DECLARE_EVENT_TABLE()
};



class iaIndentPanel : public iaSettingsPanel
{
public:
    iaIndentPanel( wxWindow *parent );
    virtual ~iaIndentPanel();

    virtual void WriteConfig();
protected:
private:
    wxCheckBox *cbShowGuides;
    wxCheckBox *cbBackspaceUnindent;
    wxCheckBox *cbBraceMatch;
    wxCheckBox *cbBraceCompletion;
};


#define iaID_HIGHLIGHTOCCURRENCES 811
#define iaID_BTN_HIGHLIGHT 812

class iaHighlightOccurrencesPanel : public iaSettingsPanel
{
public:
    iaHighlightOccurrencesPanel( wxWindow *parent );
    virtual ~iaHighlightOccurrencesPanel();

    virtual void WriteConfig();

    void OnHighlight( wxCommandEvent &evt );

    void OnButtonHighlight( wxCommandEvent &evt );
protected:
private:
    wxCheckBox *cbHighlightOccurrences;
    wxCheckBox *cbCaseSensitive;
    wxCheckBox *cbWholeWord;

    wxStaticText *stHighlightColour;
    wxButton *btnColour;

    DECLARE_EVENT_TABLE()
};


class iaTabPanel : public iaSettingsPanel
{
public:
    iaTabPanel( wxWindow *parent );
    virtual ~iaTabPanel();

    virtual void WriteConfig();
protected:
private:
    wxCheckBox *cbUseTabCharacter;
    wxCheckBox *cbTabIndents;

    wxStaticText *stTabSize;
    wxSpinCtrl *scTabSize;
};


class iaEOFPanel : public iaSettingsPanel
{
public:
    iaEOFPanel( wxWindow *parent );
    virtual ~iaEOFPanel();

    virtual void WriteConfig();
protected:
private:
    wxCheckBox *cbShowEOF;
    wxCheckBox *cbStrip;
    wxCheckBox *cbEndWithBL;
};

#define iaID_CHBOX_SL 821
#define iaID_BTN_COLOUR 822

class iaEdgePanel : public iaSettingsPanel
{
public:
    iaEdgePanel( wxWindow *parent );
    virtual ~iaEdgePanel();

    virtual void WriteConfig();

    void OnShowLine( wxCommandEvent &evt );
    void OnButtonColour( wxCommandEvent &evt );
protected:
private:
    wxCheckBox *cbShowLine;

    wxStaticText *stColumnNumber;
    wxSpinCtrl *scColumnNumber;

    wxStaticText *stColour;
    wxButton *btnColour;

    DECLARE_EVENT_TABLE()
};


#define iaID_CARET_LINEHIGHLIGHT 831
#define iaID_BTN_CARET_LINEHIGHLIGHT 832

class iaCaretPanel : public iaSettingsPanel
{
public:
    iaCaretPanel( wxWindow *parent );
    virtual ~iaCaretPanel();

    virtual void WriteConfig();

    void OnLineHighlight( wxCommandEvent &evt );
    void OnButtonColour( wxCommandEvent &evt );
protected:
private:
    wxStaticText *stWidth;
    wxSpinCtrl *scWidth;

    wxStaticText *stPeriod;
    wxSpinCtrl *scPeriod;

    wxCheckBox *cbHighlightline;

    wxStaticText *stHighlightlineColour;
    wxButton *btnHighlightlineColour;

    DECLARE_EVENT_TABLE()
};


class iaOthersPanel : public iaSettingsPanel
{
public:
    iaOthersPanel( wxWindow *parent );
    virtual ~iaOthersPanel();

    virtual void WriteConfig();
protected:
private:
    wxStaticText *stEncoding;
    wxComboBox *cbEncoding;

    wxStaticText *stShowSpaces;
    wxComboBox *cbShowSpaces;

    wxCheckBox *cbWordWrap;

    wxCheckBox *cbShowLN;
};
///////////////////////////////////////






///CODE COMPLETION
class iaSettingsCodeCompletion : public iaSettingsScrolledWindow
{
public:
    iaSettingsCodeCompletion( wxWindow *parent );
    virtual ~iaSettingsCodeCompletion();

    virtual void WriteConfig();
protected:
private:
    std::vector<iaSettingsPanel *> vectorPanel;
};


#define iaID_CB_CODE_COMPLETION 841

class iaCodeCompletionPanel : public iaSettingsPanel
{
public:
    iaCodeCompletionPanel( wxWindow *parent );
    virtual ~iaCodeCompletionPanel();

    virtual void WriteConfig();

    void OnCodeCompletion( wxCommandEvent &evt );
protected:
private:
    wxCheckBox *cbCodeCompletion;

    wxStaticText *stNumberLetters;
    wxSpinCtrl *scNumberLetters;

    wxCheckBox *cbSensitive;

    wxCheckBox *cbDropRest;

    DECLARE_EVENT_TABLE()
};

/////////////////////////////////



///FOLD
class iaSettingsFold : public iaSettingsScrolledWindow
{
public:
    iaSettingsFold( wxWindow *parent );
    virtual ~iaSettingsFold();

    virtual void WriteConfig();
protected:
private:
    std::vector<iaSettingsPanel *> vectorPanel;
};


#define iaID_CB_FOLD 851
#define iaID_BTN_FOLD_BACKGROUND 852
#define iaID_BTN_FOLD_FOREGROUND 853

class iaFoldPanel : public iaSettingsPanel
{
public:
    iaFoldPanel( wxWindow *parent );
    virtual ~iaFoldPanel();

    virtual void WriteConfig();

    void OnFold( wxCommandEvent &evt );

    void OnButtonColour( wxCommandEvent &evt );
protected:
private:
    wxCheckBox *cbFold;
    wxCheckBox *cbUnderLine;
    wxCheckBox *cbFoldComment;

    wxStaticText *stFolder;
    wxComboBox *cbFolder;
    wxButton *btnFolderBack;
    wxButton *btnFolderFore;

    wxStaticText *stFolderOpen;
    wxComboBox *cbFolderOpen;
    wxButton *btnFolderOpenBack;
    wxButton *btnFolderOpenFore;

    wxStaticText *stFolderSub;
    wxComboBox *cbFolderSub;
    wxButton *btnFolderSubBack;
    wxButton *btnFolderSubFore;

    wxStaticText *stFolderEnd;
    wxComboBox *cbFolderEnd;
    wxButton *btnFolderEndBack;
    wxButton *btnFolderEndFore;

    wxStaticText *stFolderMid;
    wxComboBox *cbFolderMid;
    wxButton *btnFolderMidBack;
    wxButton *btnFolderMidFore;

    wxStaticText *stFolderMidTail;
    wxComboBox *cbFolderMidTail;
    wxButton *btnFolderMidTailBack;
    wxButton *btnFolderMidTailFore;

    wxStaticText *stFolderTail;
    wxComboBox *cbFolderTail;
    wxButton *btnFolderTailBack;
    wxButton *btnFolderTailFore;

    DECLARE_EVENT_TABLE()
};

///////////////////////////

#endif // IASETTINGSEDITORDIALOG_H
